Skip to content

feat(session): add session export to markdown and json - #6

Merged
mevarx merged 1 commit into
mevarx:mainfrom
SultanGun:feat/session-export
Nov 11, 2026
Merged

mevarx merged 1 commit into
mevarx:mainfrom
SultanGun:feat/session-export

Conversation

@SultanGun

Copy link
Copy Markdown
Contributor

Summary

This PR introduces a new gocode session export command that allows users to export persisted GoCode sessions into portable Markdown or JSON files.

Features

  • Export the latest session or a specific session by ID.
  • Support Markdown and JSON output formats.
  • Write exported content to stdout or a specified file.
  • Add --no-tools to exclude tool calls and tool results.
  • Add --force to explicitly allow overwriting existing files.
  • Provide deterministic serialization for consistent exports.

Security and Data Handling

  • System prompts are never included in exported data.
  • Internal reasoning content is never exported.
  • File exports use restrictive permissions (0600).
  • Existing files are protected from accidental overwrites unless --force is specified.
  • Export errors and diagnostics are written to stderr, keeping stdout clean for machine-readable output.

Testing

  • Added unit tests for session serialization and export behavior.
  • Added CLI tests covering command flags, output formats, and error handling.
  • Verified with:
    • go test ./... -count=1
    • go test -race ./...
    • go vet ./...
    • gofmt -l .
    • git diff --check

All checks passed.

Scope

This PR adds session export functionality without introducing database schema migrations or external dependencies.

@mevarx
mevarx merged commit 5e765c7 into mevarx:main Nov 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants